/**
 * introduce : home页面
 * author    : yhy
 * date      : 2018/07/01
 */
import api from '@/service/api.js'

const state = {
  mdata: '初始值'
}
const getters = {}
const mutations = {
  setMsg (state, payload) {
    console.log('commit', payload)
    state.mdata = payload
  }
}
const actions = {
  async getMsg ({ commit }) {
    let result = await api.get('/getMsg')
    commit('setMsg', result.data.msg)
  }
}

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}
